/*
 * CN_MATCH_RES.h
 *
 *  Created on: 2012. 8. 17.
 *      Author: jjaehuny
 */

#ifndef _PROJECTZ_NUSER_NCOMMAND_NMATCHING_CN_MATCH_RES_H_
#define _PROJECTZ_NUSER_NCOMMAND_NMATCHING_CN_MATCH_RES_H_

#include "../../engine.h"
#include "../../User.h"

namespace ProjectZ { namespace NCommand { namespace NMatching {

class CN_MATCH_RES
{
public:
	static void OnExecute(User * pUser, ::Network::Packet * pPacket)
	{
//		PREPARE_PACKET;
//		Player_Info &player_info = pUser->player_info;
//
//		::Logger::GETLOG()->ToFile(::Logger::DEBUG, "GID \t%d CN_MATCH_RES, FighterGID %d", pUser->GetGID(), pUser->player_info.FighterGID);
//
//		int message = 0;
//		pPacket->ParseMsg("%c", & message);
//
//
//		::Network::Packet bridge;
//		bridge.MsgCat("%c", message);
//		bridge.MakePacket(CMD_SN_MATCH_RES);
//		pUser->Send(bridge);
//
//		::Logger::GETLOG()->ToFile(::Logger::DEBUG, "GID \t%d SN_MATCH_RES SENDER", pUser->GetGID());
//
//
//		if (message != 1)
//		{
//			::Logger::GETLOG()->ToFile(::Logger::DEBUG, "GID \t%d CN_MATCH_RES message=%d", pUser->GetGID(), message);
//
//			::ProjectZ::NGame::CBaseSpace *pTempWorld = ::ProjectZ::NGame::GETWORLD();
//			User *pTempTarget = pTempWorld->FindPlayer(player_info.FighterGID);
////			Player_Info &temp_target_player_info = pTempTarget->player_info;
//
//			pTempTarget->Send(bridge);
//
//			pUser->SetLocate(PL_TOWN);
//			pTempTarget->SetLocate(PL_TOWN);
//			return;
//		}
//
//		::ProjectZ::NGame::CBaseSpace *pWorld = ::ProjectZ::NGame::GETWORLD();
//		User *pTarget = pWorld->FindPlayer(player_info.FighterGID);
//		pTarget->Send(bridge);
//		Player_Info &target_player_info = pTarget->player_info;
//
//		//
//		WorldPlayerDelete(pUser);
//		WorldPlayerDelete(pTarget);
//
//		/////
//		::ProjectZ::NGame::CBaseSpace * pSpace = NULL;//::GameBase::GETSPACEBASE().clsSpaceQueue.pop();
//		if (NULL == pSpace)
//		{
//			pSpace = new ::ProjectZ::NGame::CBaseSpace;
//		}
//
//		Space_Info spaceInfo;
//		spaceInfo.eType = ::ProjectZ::NGame::CBaseSpace::PVP;
//		spaceInfo.m_MaxPlayerCount = 2;
//		spaceInfo.GID = 100;
//
//		Space_Info::RandomObject randObject;
//		randObject.sGID = 5001;
//		randObject.x = 10;
//		randObject.y = 10;
//		spaceInfo.randomObject[0] = randObject;
//
//		pSpace->SetInfo(&spaceInfo);
//
//
//		pUser->SetSpace(pSpace);
//		pSpace->EnterPlayer(pUser);
//		pTarget->SetSpace(pSpace);
//		pSpace->EnterPlayer(pTarget);
//
//		pUser->SetCoordinate(PVP_P1_START_X, PVP_P1_START_Y);
//		player_info.bReadyFight = false;
//
//		pTarget->SetCoordinate(PVP_P2_START_X, PVP_P2_START_Y, 180);
//		target_player_info.bReadyFight = false;
//
//		::Network::Packet noti;
//
//		//PVPSendMatchPlayer(pUser, 1, pTarget->nickname, pTarget->GetCharacterInfo().characterseq, pTarget->GetGID());
//		PVPSendMatchPlayer(pUser, 1, pTarget->GetUserInfo().nickname.c_str(), pTarget->GetCharacterInfo().characterseq, pTarget->GetGID());
//		pUser->SetLocate(PL_PVP_FRIENDLY);
//
//		//PVPSendMatchPlayer(pTarget, 1, pUser->nickname, pUser->GetCharacterInfo().characterseq, pUser->GetGID());
//		PVPSendMatchPlayer(pTarget, 1, pUser->GetUserInfo().nickname.c_str(), pUser->GetCharacterInfo().characterseq, pUser->GetGID());
//		pTarget->SetLocate(PL_PVP_FRIENDLY);
//
//		::Logger::GETLOG()->ToFile(::Logger::DEBUG, "GID \t%d CMD_SN_MATCH_RES SENDER, pUser GID %d, pFighter GID %d", pUser->GetGID(), pUser->GetGID(), pTarget->GetGID());
	}
};

} /*NMatching*/ } /*NCommand*/ } /*ProjectZ*/


#endif /* _PROJECTZ_NUSER_NCOMMAND_NMATCHING_CN_MATCH_RES_H_ */
